﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Text.RegularExpressions;
using System.Threading.Tasks;

namespace PtlSave.Util
{
    public class CommonUtil
    {
        public static string GetFormatDatetime(String format = "")
        {
            if ("".Equals(format) || format == null)
            {
                format = "yyyy-MM-dd HH:mm:ss.fff";
            }
            return string.Format("{0:" + format + "}", DateTime.Now);
        }

        public static bool IsInt(string value)
        {
            return "".Equals(value) ? false : Regex.IsMatch(value, @"^[+-]?\d*$");
        }
    }
}
